<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NVTX C++ API Reference: nvtx3::v1::registered_string_in&lt; D &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">NVTX C++ API Reference<span id="projectnumber">&#160;1.0</span>
   </div>
   <div id="projectbrief">C++ convenience wrappers for NVTX v3 C API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>nvtx3</b></li><li class="navelem"><b>v1</b></li><li class="navelem"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classnvtx3_1_1v1_1_1registered__string__in-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">nvtx3::v1::registered_string_in&lt; D &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>A message registered with NVTX.  
 <a href="classnvtx3_1_1v1_1_1registered__string__in.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a059adcf011e73293c1d76a512d316524" id="r_a059adcf011e73293c1d76a512d316524"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#a059adcf011e73293c1d76a512d316524">registered_string_in</a> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">char</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> *<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>) <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">noexcept</a></td></tr>
<tr class="memdesc:a059adcf011e73293c1d76a512d316524"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string.  <br /></td></tr>
<tr class="separator:a059adcf011e73293c1d76a512d316524"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e8f0b775f6363e2187f50648c5a44f5" id="r_a7e8f0b775f6363e2187f50648c5a44f5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#a7e8f0b775f6363e2187f50648c5a44f5">registered_string_in</a> (std::string <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>) <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">noexcept</a></td></tr>
<tr class="memdesc:a7e8f0b775f6363e2187f50648c5a44f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string.  <br /></td></tr>
<tr class="separator:a7e8f0b775f6363e2187f50648c5a44f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9d2c81308244bec4198167e2c8d3d4c" id="r_ab9d2c81308244bec4198167e2c8d3d4c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#ab9d2c81308244bec4198167e2c8d3d4c">registered_string_in</a> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">wchar_t</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> *<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>) <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">noexcept</a></td></tr>
<tr class="memdesc:ab9d2c81308244bec4198167e2c8d3d4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string.  <br /></td></tr>
<tr class="separator:ab9d2c81308244bec4198167e2c8d3d4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90f6112510f0745a373a7fdb162b85de" id="r_a90f6112510f0745a373a7fdb162b85de"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#a90f6112510f0745a373a7fdb162b85de">registered_string_in</a> (std::wstring <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>) <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">noexcept</a></td></tr>
<tr class="memdesc:a90f6112510f0745a373a7fdb162b85de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string.  <br /></td></tr>
<tr class="separator:a90f6112510f0745a373a7fdb162b85de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13d5f54f46e91073677fcfbe094dd261" id="r_a13d5f54f46e91073677fcfbe094dd261"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">nvtxStringHandle_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#a13d5f54f46e91073677fcfbe094dd261">get_handle</a> () <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">noexcept</a></td></tr>
<tr class="memdesc:a13d5f54f46e91073677fcfbe094dd261"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the registered string's handle.  <br /></td></tr>
<tr class="separator:a13d5f54f46e91073677fcfbe094dd261"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a9973e9bfd0bf69f2b46ce01dd4f271" id="r_a9a9973e9bfd0bf69f2b46ce01dd4f271"><td class="memItemLeft" align="right" valign="top"><a id="a9a9973e9bfd0bf69f2b46ce01dd4f271" name="a9a9973e9bfd0bf69f2b46ce01dd4f271"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>registered_string_in</b> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;)=<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">default</a></td></tr>
<tr class="separator:a9a9973e9bfd0bf69f2b46ce01dd4f271"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a942b5641e47f9e40afa97151451daea3" id="r_a942b5641e47f9e40afa97151451daea3"><td class="memItemLeft" align="right" valign="top"><a id="a942b5641e47f9e40afa97151451daea3" name="a942b5641e47f9e40afa97151451daea3"></a>
<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;)=<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">default</a></td></tr>
<tr class="separator:a942b5641e47f9e40afa97151451daea3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cd5846628e7d3c516c9f59f00d48224" id="r_a4cd5846628e7d3c516c9f59f00d48224"><td class="memItemLeft" align="right" valign="top"><a id="a4cd5846628e7d3c516c9f59f00d48224" name="a4cd5846628e7d3c516c9f59f00d48224"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>registered_string_in</b> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> &amp;&amp;)=<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">default</a></td></tr>
<tr class="separator:a4cd5846628e7d3c516c9f59f00d48224"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a237bf971ccfdf360de554ecf286ad198" id="r_a237bf971ccfdf360de554ecf286ad198"><td class="memItemLeft" align="right" valign="top"><a id="a237bf971ccfdf360de554ecf286ad198" name="a237bf971ccfdf360de554ecf286ad198"></a>
<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> &amp;&amp;)=<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">default</a></td></tr>
<tr class="separator:a237bf971ccfdf360de554ecf286ad198"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567" id="r_abf90f8765081cee5f99d971271e29567"><td class="memTemplParams" colspan="2">template&lt;typename M , typename std::enable_if&lt; detail::is_c_string&lt; decltype(M::message)&gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">get</a> () noexcept</td></tr>
<tr class="memdesc:abf90f8765081cee5f99d971271e29567"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a global instance of a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> as a function local static.  <br /></td></tr>
<tr class="separator:abf90f8765081cee5f99d971271e29567"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567" id="r_abf90f8765081cee5f99d971271e29567"><td class="memTemplParams" colspan="2">template&lt;typename M , typename std::enable_if&lt; !detail::is_c_string&lt; decltype(M::message)&gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">get</a> () noexcept</td></tr>
<tr class="memdesc:abf90f8765081cee5f99d971271e29567"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567" title="Returns a global instance of a registered_string_in as a function local static.">registered_string_in::get</a></code> to provide a clear compile error when <code>M</code> has a <code>message</code> member that is not directly convertible to either <code>char const*</code> or <code>wchar_t const*</code>.  <br /></td></tr>
<tr class="separator:abf90f8765081cee5f99d971271e29567"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567" id="r_abf90f8765081cee5f99d971271e29567"><td class="memTemplParams" colspan="2">template&lt;typename M , typename std::enable_if&lt; !detail::has_message&lt; M &gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:abf90f8765081cee5f99d971271e29567"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">get</a> () noexcept</td></tr>
<tr class="memdesc:abf90f8765081cee5f99d971271e29567"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567" title="Returns a global instance of a registered_string_in as a function local static.">registered_string_in::get</a></code> to provide a clear compile error when <code>M</code> does not have a <code>message</code> member.  <br /></td></tr>
<tr class="separator:abf90f8765081cee5f99d971271e29567"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> = domain::global&gt;<br />
class nvtx3::v1::registered_string_in&lt; D &gt;</div><p>A message registered with NVTX. </p>
<p>Normally, associating a <code>message</code> with an NVTX event requires copying the contents of the message string. This may cause non-trivial overhead in highly performance sensitive regions of code.</p>
<p>message registration is an optimization to lower the overhead of associating a message with an NVTX event. Registering a message yields a handle that is inexpensive to copy that may be used in place of a message string.</p>
<p>A particular message should only be registered once and the handle reused throughout the rest of the application. This can be done by either explicitly creating static <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> objects, or using the <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567" title="Returns a global instance of a registered_string_in as a function local static.">registered_string_in::get</a></code> construct on first use helper (recommended).</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="comment">// Explicitly constructed, static `registered_string` in my_domain:</span></div>
<div class="line"><span class="keyword">static</span> <a class="code hl_class" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in&lt;my_domain&gt;</a> <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">static_message</a>{<span class="stringliteral">&quot;message&quot;</span>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// &quot;message&quot; is associated with the range `r`</span></div>
<div class="line"><a class="code hl_typedef" href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::scoped_range</a> <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">r</a>{<a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">static_message</a>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Or use construct on first use:</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Define a type with a `message` member that defines the contents of the</span></div>
<div class="line"><span class="comment">// registered string</span></div>
<div class="line"><span class="keyword">struct </span><a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">my_message</a>{ <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code hl_class" href="classnvtx3_1_1v1_1_1message.html">message</a>{ <span class="stringliteral">&quot;my message&quot;</span> }; };</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Uses construct on first use to register the contents of</span></div>
<div class="line"><span class="comment">// `my_message::message`</span></div>
<div class="line"><span class="keyword">auto</span>&amp; <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a> = <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">registered_string_in&lt;my_domain&gt;::get&lt;my_message&gt;</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// &quot;my message&quot; is associated with the range `r`</span></div>
<div class="line"><a class="code hl_typedef" href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::scoped_range</a> <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">r</a>{<a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>};</div>
<div class="ttc" id="aclassnvtx3_1_1v1_1_1message_html"><div class="ttname"><a href="classnvtx3_1_1v1_1_1message.html">nvtx3::message</a></div><div class="ttdoc">Allows associating a message string with an NVTX event via its EventAttributes.</div><div class="ttdef"><b>Definition</b> <a href="nvtx3_8hpp_source.html#l01651">nvtx3.hpp:1651</a></div></div>
<div class="ttc" id="aclassnvtx3_1_1v1_1_1registered__string__in_html"><div class="ttname"><a href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a></div><div class="ttdoc">A message registered with NVTX.</div><div class="ttdef"><b>Definition</b> <a href="nvtx3_8hpp_source.html#l01436">nvtx3.hpp:1436</a></div></div>
<div class="ttc" id="aclassnvtx3_1_1v1_1_1registered__string__in_html_abf90f8765081cee5f99d971271e29567"><div class="ttname"><a href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">nvtx3::v1::registered_string_in::get</a></div><div class="ttdeci">static registered_string_in const &amp; get() noexcept</div><div class="ttdoc">Returns a global instance of a registered_string_in as a function local static.</div><div class="ttdef"><b>Definition</b> <a href="nvtx3_8hpp_source.html#l01476">nvtx3.hpp:1476</a></div></div>
<div class="ttc" id="anvtx3_8hpp_html_a8e124f3d438e512b586415f1ac2b9677"><div class="ttname"><a href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::v1::scoped_range</a></div><div class="ttdeci">scoped_range_in&lt; domain::global &gt; scoped_range</div><div class="ttdoc">Alias for a scoped_range_in in the global NVTX domain.</div><div class="ttdef"><b>Definition</b> <a href="nvtx3_8hpp_source.html#l02174">nvtx3.hpp:2174</a></div></div>
</div><!-- fragment --><p><code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code>s are local to a particular domain specified via the type <code>D</code>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">D</td><td>Type containing <code>name</code> member used to identify the <code>domain</code> to which the <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> belongs. Else, <code><a class="el" href="structnvtx3_1_1v1_1_1domain_1_1global.html" title="Tag type for the &quot;global&quot; NVTX domain.">domain::global</a></code> to indicate that the global NVTX domain should be used. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01436">1436</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a059adcf011e73293c1d76a512d316524" name="a059adcf011e73293c1d76a512d316524"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a059adcf011e73293c1d76a512d316524">&#9670;&#160;</a></span>registered_string_in() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a>  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> &gt;::registered_string_in </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">char</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string. </p>
<p>Registers <code>msg</code> with NVTX and associates a handle with the registered message.</p>
<p>A particular message should should only be registered once and the handle reused throughout the rest of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>The contents of the message </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01538">1538</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a7e8f0b775f6363e2187f50648c5a44f5" name="a7e8f0b775f6363e2187f50648c5a44f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e8f0b775f6363e2187f50648c5a44f5">&#9670;&#160;</a></span>registered_string_in() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a>  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> &gt;::registered_string_in </td>
          <td>(</td>
          <td class="paramtype">std::string <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string. </p>
<p>Registers <code>msg</code> with NVTX and associates a handle with the registered message.</p>
<p>A particular message should should only be registered once and the handle reused throughout the rest of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>The contents of the message </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01554">1554</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="ab9d2c81308244bec4198167e2c8d3d4c" name="ab9d2c81308244bec4198167e2c8d3d4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9d2c81308244bec4198167e2c8d3d4c">&#9670;&#160;</a></span>registered_string_in() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a>  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> &gt;::registered_string_in </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">wchar_t</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string. </p>
<p>Registers <code>msg</code> with NVTX and associates a handle with the registered message.</p>
<p>A particular message should should only be registered once and the handle reused throughout the rest of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>The contents of the message </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01568">1568</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a90f6112510f0745a373a7fdb162b85de" name="a90f6112510f0745a373a7fdb162b85de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90f6112510f0745a373a7fdb162b85de">&#9670;&#160;</a></span>registered_string_in() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a>  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> &gt;::registered_string_in </td>
          <td>(</td>
          <td class="paramtype">std::wstring <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">const</a> &amp;&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> from the specified <code>msg</code> string. </p>
<p>Registers <code>msg</code> with NVTX and associates a handle with the registered message.</p>
<p>A particular message should only be registered once and the handle reused throughout the rest of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>The contents of the message </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01584">1584</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="abf90f8765081cee5f99d971271e29567" name="abf90f8765081cee5f99d971271e29567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf90f8765081cee5f99d971271e29567">&#9670;&#160;</a></span>get() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename M , typename std::enable_if&lt; detail::is_c_string&lt; decltype(M::message)&gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a global instance of a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> as a function local static. </p>
<p>Provides a convenient way to register a message with NVTX without having to explicitly register the message.</p>
<p>Upon first invocation, constructs a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> whose contents are specified by <code><a class="el" href="classnvtx3_1_1v1_1_1message.html#abdbef47b3202d55a8b956da6b1296448" title="Construct a message whose contents are specified by msg.">message::message</a></code>.</p>
<p>All future invocations will return a reference to the object constructed in the first invocation.</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="comment">// Define a type with a `message` member that defines the contents of the</span></div>
<div class="line"><span class="comment">// registered string</span></div>
<div class="line"><span class="keyword">struct </span><a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">my_message</a>{ <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code hl_class" href="classnvtx3_1_1v1_1_1message.html">message</a>{ <span class="stringliteral">&quot;my message&quot;</span> };</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Uses construct on first use to register the contents of</span></div>
<div class="line"><span class="comment">// `my_message::message`</span></div>
<div class="line"><span class="keyword">auto</span>&amp; <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a> = <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">registered_string_in&lt;my_domain&gt;::get&lt;my_message&gt;</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// &quot;my message&quot; is associated with the range `r`</span></div>
<div class="line">nvtx3::scoped_range <a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">r</a>{<a class="code hl_function" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">msg</a>};</div>
</div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">M</td><td>Type required to contain a member <code>M::message</code> that resolves to either a <code>char const*</code> or <code>wchar_t const*</code> used as the registered string's contents. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to a <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html" title="A message registered with NVTX.">registered_string_in</a></code> associated with the type <code>M</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01476">1476</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="abf90f8765081cee5f99d971271e29567" name="abf90f8765081cee5f99d971271e29567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf90f8765081cee5f99d971271e29567">&#9670;&#160;</a></span>get() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename M , typename std::enable_if&lt; !detail::is_c_string&lt; decltype(M::message)&gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567" title="Returns a global instance of a registered_string_in as a function local static.">registered_string_in::get</a></code> to provide a clear compile error when <code>M</code> has a <code>message</code> member that is not directly convertible to either <code>char const*</code> or <code>wchar_t const*</code>. </p>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01491">1491</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="abf90f8765081cee5f99d971271e29567" name="abf90f8765081cee5f99d971271e29567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf90f8765081cee5f99d971271e29567">&#9670;&#160;</a></span>get() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename M , typename std::enable_if&lt; !detail::has_message&lt; M &gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">registered_string_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567" title="Returns a global instance of a registered_string_in as a function local static.">registered_string_in::get</a></code> to provide a clear compile error when <code>M</code> does not have a <code>message</code> member. </p>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01509">1509</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a13d5f54f46e91073677fcfbe094dd261" name="a13d5f54f46e91073677fcfbe094dd261"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13d5f54f46e91073677fcfbe094dd261">&#9670;&#160;</a></span>get_handle()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;<a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">typename</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a>  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">nvtxStringHandle_t</a> <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html">nvtx3::v1::registered_string_in</a>&lt; <a class="el" href="classnvtx3_1_1v1_1_1registered__string__in.html#abf90f8765081cee5f99d971271e29567">D</a> &gt;::get_handle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the registered string's handle. </p>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01591">1591</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
